﻿<phone:PhoneApplicationPage
    x:Class="Ch9RSS_WP8.SectionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:convert="clr-namespace:Ch9RSS_WP8.Converters"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <convert:ThumbConverter x:Key="ThumbConverter" />
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- TitlePanel -->
        <StackPanel Grid.Row="0" Margin="0,0,0,0" Background="{StaticResource Ch9Orange}">
            <TextBlock Margin="20,5,0,0" Foreground="White"  Text="CHANNEL 9 VIEWER" />
            <TextBlock Text="{Binding SelectedSeries}" Foreground="White"  
                       Margin="20,12,0,12" TextWrapping="Wrap"/>
        </StackPanel>

        <phone:LongListSelector
            x:Name="itemGridView"
            TabIndex="1"
            Grid.Row="1"
            Padding="12,0,0,0"
            ItemsSource="{Binding SeriesItems}"
            SelectionChanged="itemGridView_SelectionChanged"
            Grid.RowSpan="2" >
            <phone:LongListSelector.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="10" Height="225">
                        <Border x:Name="parentBorder" Background="{StaticResource Ch9Orange}">
                            <Image Source="{Binding thumbnail, Converter={StaticResource ThumbConverter}}" 
                                   Stretch="UniformToFill" 
                                   AutomationProperties.Name="{Binding Title}" 
                                   />
                        </Border>
                        <StackPanel VerticalAlignment="Bottom" Margin="0,0,0,0" Background="#CCF97600">
                            <TextBlock Text="{Binding title}" 
                                       Foreground="White" 
                                       Style="{StaticResource PhoneTextTitle1Style}"
                                       TextWrapping="Wrap" 
                                       Margin="5,5,5,10" FontSize="18" 
                                       FontFamily="Global User Interface" />
                        </StackPanel>
                    </Grid>
                </DataTemplate>
                </phone:LongListSelector.ItemTemplate>
         
            </phone:LongListSelector>
    </Grid>
</phone:PhoneApplicationPage>